import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token'
const userIdKey = "userId"
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}


//将用户的id存储在sessionStorage中
export function setUserId(userId) {
  return localStorage.setItem(userIdKey,userId)
}

export function getUserId() {
  return localStorage.getItem(userIdKey)
}

export function removeUserId(userId) {
  return localStorage.removeItem(userIdKey)
}
//情况session
export function clearSession() {
  return localStorage.clear()
}

